package com.lpwa.web.controller;
import com.lpwa.common.DataUtils;
import com.lpwa.common.core.controller.BaseController;
import org.jsoup.helper.DataUtil;
import org.springframework.util.DigestUtils;
import org.springframework.util.unit.DataUnit;

public class Test extends BaseController
{
	public static void main(String[] args){
		String did="120542024562436";
		String key="445009494aa827f737c6bd7379953a99";
		String name = "";
		String nameMd5Str = did + key;
		name= DigestUtils.md5DigestAsHex(nameMd5Str.getBytes());
		name = name.substring(12,20).toUpperCase();
		name = "XL-" + name;
		String optId="865787690987651";
		String utc =Long.toString(1608627960);
		String encodeByMd5Str = key + optId +utc;
		String md5Str =DigestUtils.md5DigestAsHex(encodeByMd5Str.getBytes());
		String token=md5Str.substring(8, 24);
//		System.out.println("optId:"+optId);
//		System.out.println("utc:"+utc);
//		System.out.println("key + optId +utc:"+encodeByMd5Str);
//		System.out.println("MD5:"+md5Str);
//		System.out.println("token:"+token);
		int i = 100;
		int j = i%20;
		System.out.println("token:"+j);
//		int a = 20;
		String a = DataUtils.intTohexTowByte(1000);
		DataUtils.converLeAndBig(a);
		System.out.println("a:"+DataUtils.converLeAndBig(a));
	}
}
